home *** CD-ROM | disk | FTP | other *** search
- Path: news.asu.edu!simoner
- From: simoner@imap2.asu.edu
- Newsgroups: comp.lang.c++
- Subject: structs as member of classes
- Date: 13 Mar 1996 07:33:33 GMT
- Organization: Arizona State University
- Message-ID: <4i5tod$qhe@news.asu.edu>
- NNTP-Posting-Host: general5.asu.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- I get the error
-
- Error: Character::CharPlayer may not be a type name.
- Error: Badly formed expression.
-
- when trying to change the value in a struct which is a private member of
- a class.
- here is the code.
-
- void Character::init_player()
- {
- CharPlayer.PlrSts.strength = 15;
- ...
- }
-
- and the call is
-
- player1.init_player();
-
- I realize this is probably just a lame syntax problem, but it has irked
- me for a couple of hours. Seeing I don't have a manual.
- Thanks in advance.
- -Simon
-